﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Kovan.Model.ViewModel.UserCenter;
using Kovan.Model.Parameter.UserCenter;
using Kovan.DAL.UserCenter;
using Kovan.Model.Common;

namespace Kovan.BLL.UserCenter
{
    public class BUserManage
    {
        DUserManage dal = new DUserManage();
        #region 当前类的实例.
        private static readonly BUserManage Instances = new BUserManage();

        private BUserManage() { }

        public static BUserManage GetInstances()
        {
            return Instances;
        }
        #endregion

        public IEnumerable<EUser> GetUserItems(PUser param)
        {
            return dal.GetUserItems(param);
        }

        public EUser GetUserModel(string ukey)
        {
            return dal.GetUserModel(ukey);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="roleid"></param>
        /// <returns></returns>
        public IEnumerable<Menu> GetUserMenu(int roleid)
        {
            return dal.GetUserMenu(roleid);
        }

        /// <summary>
        /// 根据角色ID获取权限
        /// </summary>
        /// <param name="roid_id"></param>
        /// <returns></returns>
        public IEnumerable<ERoleAuthority> GetRoleAuthority(int roid_id)
        {
            return dal.GetRoleAuthority(roid_id);
        }
    }
}
